﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports Battleship

'''<summary>
'''This is a test class for BattleshipGameTest and is intended
'''to contain all BattleshipGameTest Unit Tests
'''</summary>
<TestClass()> _
Public Class BattleshipGameTest


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    'You can use the following additional attributes as you write your tests:
    '
    'Use ClassInitialize to run code before running the first test in the class
    '<ClassInitialize()>  _
    'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    'End Sub
    '
    'Use ClassCleanup to run code after all tests in a class have run
    '<ClassCleanup()>  _
    'Public Shared Sub MyClassCleanup()
    'End Sub
    '
    'Use TestInitialize to run code before running each test
    '<TestInitialize()>  _
    'Public Sub MyTestInitialize()
    'End Sub
    '
    'Use TestCleanup to run code after each test has run
    '<TestCleanup()>  _
    'Public Sub MyTestCleanup()
    'End Sub
    '
#End Region


    '''<summary>
    '''A test for BattleshipGame Constructor
    '''</summary>
    <TestMethod()> _
    Public Sub BattleshipGameConstructorTest()
        Dim target As BattleshipGame = New BattleshipGame()
    End Sub

    '''<summary>
    '''A test for CheckWinConditions
    '''</summary>
    <TestMethod()> _
    Public Sub CheckWinConditionsTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Boolean = False
        Dim actual As Boolean
        actual = target.CheckWinConditions
        Assert.AreEqual(expected, actual)
    End Sub

   

    '''<summary>
    '''A test for CurrentPhase
    '''</summary>
    <TestMethod()> _
    Public Sub CurrentPhaseTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 1
        Dim actual As Integer
        target.CurrentPhase = expected
        actual = target.CurrentPhase
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for CurrentPlayerTurn
    '''</summary>
    <TestMethod()> _
    Public Sub CurrentPlayerTurnTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 2
        Dim actual As Integer
        target.CurrentPlayerTurn = expected
        actual = target.CurrentPlayerTurn
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1FiringGrid
    '''</summary>
    <TestMethod()> _
    Public Sub Player1FiringGridTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As New BattleshipGameGrid(1, False, True)
        Dim actual As New BattleshipGameGrid(1, False, True)
        target.Player1FiringGrid = expected
        actual = target.Player1FiringGrid
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1Lives
    '''</summary>
    <TestMethod()> _
    Public Sub Player1LivesTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 15
        Dim actual As Integer
        target.Player1Lives = expected
        actual = target.Player1Lives
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1Losses
    '''</summary>
    <TestMethod()> _
    Public Sub Player1LossesTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 0
        Dim actual As Integer
        target.Player1Losses = expected
        actual = target.Player1Losses
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1Name
    '''</summary>
    <TestMethod()> _
    Public Sub Player1NameTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As String = "Steve"
        Dim actual As String
        target.Player1Name = expected
        actual = target.Player1Name
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1TrackingGrid
    '''</summary>
    <TestMethod()> _
    Public Sub Player1TrackingGridTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As New BattleshipGameGrid(1, True, False)
        Dim actual As New BattleshipGameGrid(1, True, False)
        target.Player1TrackingGrid = expected
        actual = target.Player1TrackingGrid
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player1Wins
    '''</summary>
    <TestMethod()> _
    Public Sub Player1WinsTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 1
        Dim actual As Integer
        target.Player1Wins = expected
        actual = target.Player1Wins
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2FiringGrid
    '''</summary>
    <TestMethod()> _
    Public Sub Player2FiringGridTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As New BattleshipGameGrid(2, False, True)
        Dim actual As New BattleshipGameGrid(2, False, True)
        target.Player2FiringGrid = expected
        actual = target.Player2FiringGrid
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2Lives
    '''</summary>
    <TestMethod()> _
    Public Sub Player2LivesTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 15
        Dim actual As Integer
        target.Player2Lives = expected
        actual = target.Player2Lives
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2Losses
    '''</summary>
    <TestMethod()> _
    Public Sub Player2LossesTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 2
        Dim actual As Integer
        target.Player2Losses = expected
        actual = target.Player2Losses
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2Name
    '''</summary>
    <TestMethod()> _
    Public Sub Player2NameTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As String = "Bobo"
        Dim actual As String
        target.Player2Name = expected
        actual = target.Player2Name
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2TrackingGrid
    '''</summary>
    <TestMethod()> _
    Public Sub Player2TrackingGridTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As New BattleshipGameGrid(2, True, False)
        Dim actual As New BattleshipGameGrid(2, True, False)
        target.Player2TrackingGrid = expected
        actual = target.Player2TrackingGrid
        Assert.AreEqual(expected, actual)
    End Sub

    '''<summary>
    '''A test for Player2Wins
    '''</summary>
    <TestMethod()> _
    Public Sub Player2WinsTest()
        Dim target As BattleshipGame = New BattleshipGame()
        Dim expected As Integer = 17
        Dim actual As Integer
        target.Player2Wins = expected
        actual = target.Player2Wins
        Assert.AreEqual(expected, actual)
    End Sub
End Class
